#include <bits/stdc++.h>
#define clr(a) memset(a, 0, sizeof a)
using namespace std;
const int N = 2300+10;
int n, m, d[N], V[N];
void add(int &a, int b){a = (a+b)%10;}
void sub(int &a, int b){a = (a-b+10)%10;}
signed main() {
    ios::sync_with_stdio(false);cin.tie(nullptr);
    while (cin >> n >> m){
        clr(d);
        for (int i = 1; i <= n; ++i) {
            cin >> V[i];
        }
        d[0] = 1;
        for (int i = 1; i <= n; ++i) {
            int v = V[i];
            for (int c = m; c>=v; --c) {
                add(d[c], d[c-v]);
            }
        }
        int t[N];
        for (int i = 1; i <= n ; ++i) {
            int v = V[i];
            for (int j = 0; j <= m; ++j) {
                if(j-v>=0) t[j] = (d[j] - t[j-v] + 10)%10;
                else t[j] = d[j];
            }
            for (int j = 1; j <= m; ++j) {
                cout << t[j];
            }
            cout << endl;
        }
    }

    return 0;
}